home *** CD-ROM | disk | FTP | other *** search
Text File | 2000-09-28 | 8.9 KB | 317 lines | [TEXT/CWIE] |
- //****************************************************************************************
- // BCEngine.i.c
- //
- // Copyright 1999 by Apple Computer, Inc.
- //----------------------------------------------------------------------------------------
-
- #include <AVComponents.h>
- #include <MixedMode.h>
-
- #include "BCEngine.h"
-
-
-
- pascal ContrastEngineResult ContrastEngineGetBrightnessRange(ComponentInstance ec, short* min, short* max)
- {
- #if PRAGMA_STRUCT_ALIGN
- #pragma options align=mac68k
- #elif PRAGMA_STRUCT_PACKPUSH
- #pragma pack(push, 2)
- #elif PRAGMA_STRUCT_PACK
- #pragma pack(2)
- #endif
- struct ContrastEngineGetBrightnessRangeGluePB {
- unsigned char componentFlags;
- unsigned char componentParamSize;
- short componentWhat;
- short* max;
- short* min;
- ComponentInstance ec;
- };
- #if PRAGMA_STRUCT_ALIGN
- #pragma options align=reset
- #elif PRAGMA_STRUCT_PACKPUSH
- #pragma pack(pop)
- #elif PRAGMA_STRUCT_PACK
- #pragma pack()
- #endif
-
- #if OLD_COMPONENT_GLUE
- struct ContrastEngineGetBrightnessRangeGluePB myContrastEngineGetBrightnessRangeGluePB = {
- 0,
- 8,
- 0
- };
-
- #else
- struct ContrastEngineGetBrightnessRangeGluePB myContrastEngineGetBrightnessRangeGluePB;
- *((unsigned long*)&myContrastEngineGetBrightnessRangeGluePB) = 0x00080000;
- #endif
-
- myContrastEngineGetBrightnessRangeGluePB.max = max;
- myContrastEngineGetBrightnessRangeGluePB.min = min;
- myContrastEngineGetBrightnessRangeGluePB.ec = ec;
-
- return (ContrastEngineResult)CallUniversalProc(CallComponentUPP, 0x000000F0, &myContrastEngineGetBrightnessRangeGluePB);
- }
-
-
- pascal ContrastEngineResult ContrastEngineGetBrightness(ComponentInstance ec, short* brightness)
- {
- #if PRAGMA_STRUCT_ALIGN
- #pragma options align=mac68k
- #elif PRAGMA_STRUCT_PACKPUSH
- #pragma pack(push, 2)
- #elif PRAGMA_STRUCT_PACK
- #pragma pack(2)
- #endif
- struct ContrastEngineGetBrightnessGluePB {
- unsigned char componentFlags;
- unsigned char componentParamSize;
- short componentWhat;
- short* brightness;
- ComponentInstance ec;
- };
- #if PRAGMA_STRUCT_ALIGN
- #pragma options align=reset
- #elif PRAGMA_STRUCT_PACKPUSH
- #pragma pack(pop)
- #elif PRAGMA_STRUCT_PACK
- #pragma pack()
- #endif
-
- #if OLD_COMPONENT_GLUE
- struct ContrastEngineGetBrightnessGluePB myContrastEngineGetBrightnessGluePB = {
- 0,
- 4,
- 1
- };
-
- #else
- struct ContrastEngineGetBrightnessGluePB myContrastEngineGetBrightnessGluePB;
- *((unsigned long*)&myContrastEngineGetBrightnessGluePB) = 0x00040001;
- #endif
-
- myContrastEngineGetBrightnessGluePB.brightness = brightness;
- myContrastEngineGetBrightnessGluePB.ec = ec;
-
- return (ContrastEngineResult)CallUniversalProc(CallComponentUPP, 0x000000F0, &myContrastEngineGetBrightnessGluePB);
- }
-
-
- pascal ContrastEngineResult ContrastEngineSetBrightness(ComponentInstance ec, short brightness)
- {
- #if PRAGMA_STRUCT_ALIGN
- #pragma options align=mac68k
- #elif PRAGMA_STRUCT_PACKPUSH
- #pragma pack(push, 2)
- #elif PRAGMA_STRUCT_PACK
- #pragma pack(2)
- #endif
- struct ContrastEngineSetBrightnessGluePB {
- unsigned char componentFlags;
- unsigned char componentParamSize;
- short componentWhat;
- short brightness;
- ComponentInstance ec;
- };
- #if PRAGMA_STRUCT_ALIGN
- #pragma options align=reset
- #elif PRAGMA_STRUCT_PACKPUSH
- #pragma pack(pop)
- #elif PRAGMA_STRUCT_PACK
- #pragma pack()
- #endif
-
- #if OLD_COMPONENT_GLUE
- struct ContrastEngineSetBrightnessGluePB myContrastEngineSetBrightnessGluePB = {
- 0,
- 2,
- 2
- };
-
- #else
- struct ContrastEngineSetBrightnessGluePB myContrastEngineSetBrightnessGluePB;
- *((unsigned long*)&myContrastEngineSetBrightnessGluePB) = 0x00020002;
- #endif
-
- myContrastEngineSetBrightnessGluePB.brightness = brightness;
- myContrastEngineSetBrightnessGluePB.ec = ec;
-
- return (ContrastEngineResult)CallUniversalProc(CallComponentUPP, 0x000000F0, &myContrastEngineSetBrightnessGluePB);
- }
-
-
- pascal ContrastEngineResult ContrastEngineGetContrastRange(ComponentInstance ec, short* min, short* max)
- {
- #if PRAGMA_STRUCT_ALIGN
- #pragma options align=mac68k
- #elif PRAGMA_STRUCT_PACKPUSH
- #pragma pack(push, 2)
- #elif PRAGMA_STRUCT_PACK
- #pragma pack(2)
- #endif
- struct ContrastEngineGetContrastRangeGluePB {
- unsigned char componentFlags;
- unsigned char componentParamSize;
- short componentWhat;
- short* max;
- short* min;
- ComponentInstance ec;
- };
- #if PRAGMA_STRUCT_ALIGN
- #pragma options align=reset
- #elif PRAGMA_STRUCT_PACKPUSH
- #pragma pack(pop)
- #elif PRAGMA_STRUCT_PACK
- #pragma pack()
- #endif
-
- #if OLD_COMPONENT_GLUE
- struct ContrastEngineGetContrastRangeGluePB myContrastEngineGetContrastRangeGluePB = {
- 0,
- 8,
- 3
- };
-
- #else
- struct ContrastEngineGetContrastRangeGluePB myContrastEngineGetContrastRangeGluePB;
- *((unsigned long*)&myContrastEngineGetContrastRangeGluePB) = 0x00080003;
- #endif
-
- myContrastEngineGetContrastRangeGluePB.max = max;
- myContrastEngineGetContrastRangeGluePB.min = min;
- myContrastEngineGetContrastRangeGluePB.ec = ec;
-
- return (ContrastEngineResult)CallUniversalProc(CallComponentUPP, 0x000000F0, &myContrastEngineGetContrastRangeGluePB);
- }
-
-
- pascal ContrastEngineResult ContrastEngineGetContrast(ComponentInstance ec, short* contrast)
- {
- #if PRAGMA_STRUCT_ALIGN
- #pragma options align=mac68k
- #elif PRAGMA_STRUCT_PACKPUSH
- #pragma pack(push, 2)
- #elif PRAGMA_STRUCT_PACK
- #pragma pack(2)
- #endif
- struct ContrastEngineGetContrastGluePB {
- unsigned char componentFlags;
- unsigned char componentParamSize;
- short componentWhat;
- short* contrast;
- ComponentInstance ec;
- };
- #if PRAGMA_STRUCT_ALIGN
- #pragma options align=reset
- #elif PRAGMA_STRUCT_PACKPUSH
- #pragma pack(pop)
- #elif PRAGMA_STRUCT_PACK
- #pragma pack()
- #endif
-
- #if OLD_COMPONENT_GLUE
- struct ContrastEngineGetContrastGluePB myContrastEngineGetContrastGluePB = {
- 0,
- 4,
- 4
- };
-
- #else
- struct ContrastEngineGetContrastGluePB myContrastEngineGetContrastGluePB;
- *((unsigned long*)&myContrastEngineGetContrastGluePB) = 0x00040004;
- #endif
-
- myContrastEngineGetContrastGluePB.contrast = contrast;
- myContrastEngineGetContrastGluePB.ec = ec;
-
- return (ContrastEngineResult)CallUniversalProc(CallComponentUPP, 0x000000F0, &myContrastEngineGetContrastGluePB);
- }
-
-
- pascal ContrastEngineResult ContrastEngineSetContrast(ComponentInstance ec, short contrast)
- {
- #if PRAGMA_STRUCT_ALIGN
- #pragma options align=mac68k
- #elif PRAGMA_STRUCT_PACKPUSH
- #pragma pack(push, 2)
- #elif PRAGMA_STRUCT_PACK
- #pragma pack(2)
- #endif
- struct ContrastEngineSetContrastGluePB {
- unsigned char componentFlags;
- unsigned char componentParamSize;
- short componentWhat;
- short contrast;
- ComponentInstance ec;
- };
- #if PRAGMA_STRUCT_ALIGN
- #pragma options align=reset
- #elif PRAGMA_STRUCT_PACKPUSH
- #pragma pack(pop)
- #elif PRAGMA_STRUCT_PACK
- #pragma pack()
- #endif
-
- #if OLD_COMPONENT_GLUE
- struct ContrastEngineSetContrastGluePB myContrastEngineSetContrastGluePB = {
- 0,
- 2,
- 5
- };
-
- #else
- struct ContrastEngineSetContrastGluePB myContrastEngineSetContrastGluePB;
- *((unsigned long*)&myContrastEngineSetContrastGluePB) = 0x00020005;
- #endif
-
- myContrastEngineSetContrastGluePB.contrast = contrast;
- myContrastEngineSetContrastGluePB.ec = ec;
-
- return (ContrastEngineResult)CallUniversalProc(CallComponentUPP, 0x000000F0, &myContrastEngineSetContrastGluePB);
- }
-
-
- pascal ComponentResult AVEngineComponentTargetDevice(ComponentInstance engineComponent, DisplayIDType displayID)
- {
- #if PRAGMA_STRUCT_ALIGN
- #pragma options align=mac68k
- #elif PRAGMA_STRUCT_PACKPUSH
- #pragma pack(push, 2)
- #elif PRAGMA_STRUCT_PACK
- #pragma pack(2)
- #endif
- struct AVEngineComponentTargetDeviceGluePB {
- unsigned char componentFlags;
- unsigned char componentParamSize;
- short componentWhat;
- DisplayIDType displayID;
- ComponentInstance engineComponent;
- };
- #if PRAGMA_STRUCT_ALIGN
- #pragma options align=reset
- #elif PRAGMA_STRUCT_PACKPUSH
- #pragma pack(pop)
- #elif PRAGMA_STRUCT_PACK
- #pragma pack()
- #endif
-
- #if OLD_COMPONENT_GLUE
- struct AVEngineComponentTargetDeviceGluePB myAVEngineComponentTargetDeviceGluePB = {
- 0,
- 4,
- 257
- };
-
- #else
- struct AVEngineComponentTargetDeviceGluePB myAVEngineComponentTargetDeviceGluePB;
- *((unsigned long*)&myAVEngineComponentTargetDeviceGluePB) = 0x00040101;
- #endif
-
- myAVEngineComponentTargetDeviceGluePB.displayID = displayID;
- myAVEngineComponentTargetDeviceGluePB.engineComponent = engineComponent;
-
- return (ComponentResult)CallUniversalProc(CallComponentUPP, 0x000000F0, &myAVEngineComponentTargetDeviceGluePB);
- }
-